package validator

import "gitee.com/baal1990/epidemic/global"

// ValidateDepartment 校验部门
func ValidateDepartment(department, operatingDepartment string) bool {
	switch operatingDepartment {
	case global.DEPARTMENT_BEIJING_DALIAN:
		return department == global.DEPARTMENT_BEIJING || department == global.DEPARTMENT_BEIJING_DALIAN
	case global.DEPARTMENT_BEIJING:
		return department == global.DEPARTMENT_BEIJING || department == global.DEPARTMENT_BEIJING_DALIAN
	case global.DEPARTMENT_PROJECT_OUTSOURCING:
		return department == global.DEPARTMENT_PROJECT_OUTSOURCING || department == global.DEPARTMENT_QA
	case global.DEPARTMENT_DATA_2:
		return department == global.DEPARTMENT_DATA_2 || department == global.DEPARTMENT_QA
	case global.DEPARTMENT_OFFICE_AUTOMATION:
		return department == global.DEPARTMENT_OFFICE_AUTOMATION || department == global.DEPARTMENT_QA
	default:
		return department == operatingDepartment
	}
}
